package com.zz.ecommerce.declareManage.importB2CDeclareDirect.orderManageQdc;

import com.zz.ecommerce.common.GridRequest;
import com.zz.ecommerce.common.GridResult;
import com.zz.ecommerce.common.bean.qdc.db.TOrderHeadQdc;
import com.zz.ecommerce.common.constants.DictConstants;
import com.zz.ecommerce.common.constants.TableConstants;
import com.zz.ecommerce.declareManage.common.service.QdcOrderService;
import com.zz.ecommerce.pojo.CbecOrder;
import com.zz.ecommerce.utils.SessionUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpSession;

/**
 * Created by steven on 2016/3/28.
 */
@Controller
@RequestMapping("/importB2cDirect/orderManageQdc")
public class QdcIB2cDirectOrderController {

    @Autowired
    private CbecOrderDao cbecOrderDao;

    @RequestMapping("/init")
    public String init() {
        return "declareManage/importB2CDeclareDirect/orderManageQdc/index";
    }

    @RequestMapping("/queryOrderList")
    @ResponseBody
    public GridResult queryOrderList(CbecOrder cbecOrder, GridRequest request, HttpSession session) {
        cbecOrder.setOrgId(SessionUtil.getOrganizationId(session));
        return new GridResult(cbecOrderDao.page(TableConstants.CBEC_ORDER, cbecOrder, request.getStart(), request.getEnd(), request.getSortOrder()), request, cbecOrderDao.count(TableConstants.CBEC_ORDER, cbecOrder));
    }
}
